From 4b6ebdef8281a413fa2bfbdf8f5565eb8b106c62 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Fri, 7 Nov 2025 03:00:58 +0000 Subject: (임수민) 데이터룸 최근활동 캐시 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/projects/[projectId]/stats/route.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'app/api/projects/[projectId]/stats/route.ts') diff --git a/app/api/projects/[projectId]/stats/route.ts b/app/api/projects/[projectId]/stats/route.ts index dc2397ac..d3d42a17 100644 --- a/app/api/projects/[projectId]/stats/route.ts +++ b/app/api/projects/[projectId]/stats/route.ts @@ -201,9 +201,13 @@ export async function GET( }; roleStats.forEach(stat => { - if (stat.role === 'manager') byRole.admin = Number(stat.count); - else if (stat.role === 'member') byRole.editor = Number(stat.count); - else byRole.viewer = Number(stat.count); + if (stat.role === 'owner' || stat.role === 'admin') { + byRole.admin = Number(stat.count); + } else if (stat.role === 'editor') { + byRole.editor = Number(stat.count); + } else { + byRole.viewer = Number(stat.count); + } }); // 4. 최근 활동 내역 @@ -263,7 +267,13 @@ export async function GET( recent, }; - return NextResponse.json(stats); + return NextResponse.json(stats, { + headers: { + 'Cache-Control': 'no-store, no-cache, must-revalidate, proxy-revalidate', + 'Pragma': 'no-cache', + 'Expires': '0', + }, + }); } catch (error) { console.error('통계 조회 오류:', error); -- cgit v1.2.3